export function maxLength(name: string, length: number){
  return (value: string) => {
    if (value.length > length) {
      return `${name} length can't more than ${length}.`
    }
    return true
  }
}

export function required(name: string,){
  return (value: string) => {
    if (value) {
      return true
    }
    return `${name} is required.`
  }
}
